np,nq,nr = map(int,input().split())
s = np+nq+nr
hashmap = {"p":np,"q":nq,"r":nr}
mem = {"p":np,"q":nq,"r":nr}

def back(l,map,x):
    if len(l) == s:
        res.append(l)
    else:
        if mem[x] <= hashmap[x]:
            mem[x] -= 1
            l.append(x)
            for y in ["p","q","r"]:
                if y==x: continue
                if hashmap[y] >= mem[y]:
                    mem[y] -= 1
                    back(l,map,y)
res = []
for x in ["p","q","r"]:
    cur = []
    back(cur, hashmap, x)
print(len(res))


